﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TestCAI.DTO;



namespace TestCAI.Controllers
{
    public class _BaseController : Controller
    {
        public List<ShoppingCenterDTO> ShoppingCenters
        {
            get
            {
                if (this.Session.Contents["ShoppingCenters"] == null)
                {

                        //Populate shopping center
                        List<ShoppingCenterDTO> lstShoppingCenters = new List<ShoppingCenterDTO>()
                            {
                                new ShoppingCenterDTO() { StoreNumber = 352, ShoppingCenterName = "Oakbridge"},
                                new ShoppingCenterDTO() { StoreNumber = 356, ShoppingCenterName = "Lake Miriam"},
                                new ShoppingCenterDTO() { StoreNumber = 1270, ShoppingCenterName = "Southgate"},
                                new ShoppingCenterDTO() { StoreNumber = 111, ShoppingCenterName = "Some Shopping Center"}
                            };

                        this.Session.Contents["ShoppingCenters"] = lstShoppingCenters;

                        return (List<ShoppingCenterDTO>)this.Session.Contents["ShoppingCenters"];
                }
                else
                {
                    return (List<ShoppingCenterDTO>)this.Session.Contents["ShoppingCenters"];
                }
            }
            set
            {
                if (value == null)
                {
                    this.Session.Contents["ShoppingCenters"] = null;
                }
                else
                {
                    this.Session.Contents["ShoppingCenters"] = value;
                }
            }
        }
    }
}
